package model;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class ReadFile {

	public static String readFile(String pathname)
			throws FileNotFoundException, IOException {
		String result = null;
		DataInputStream dis = new DataInputStream(new BufferedInputStream(
				new FileInputStream(pathname)));
		result = dis.readUTF();
		dis.close();
		return result;
	}

	public static void main(String[] args) {
		try {
			// DataOutputStream dos = new DataOutputStream(
			// new BufferedOutputStream(new FileOutputStream(new File("")
			// .getAbsolutePath().concat("\\data\\data"))));
			// dos.writeUTF(Encryption.encrypt("adminHaricSilver"));
			// dos.close();
			System.out.println(readFile(new File("").getAbsolutePath().concat(
					"\\data\\data")));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}
